package com.briup.estore.bean;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.util.ArrayList;
import java.util.List;


@ApiModel("树状结构数据基础类")
@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
public class TreeNode {
    @Override
    public String toString() {
        return "TreeNode{" +
                "id=" + id +
                ", parentId=" + parentId +
                ", children=" + children +
                '}';
    }

    /**
     * id
     */
    @ApiModelProperty("id")
    public Integer id;

    /**
     * 父ID
     */
    @ApiModelProperty("父ID")
    public Integer parentId;

    /**
     * 子信息
     */
    @ApiModelProperty("子信息")
    private List children = new ArrayList<>();
}
